/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hello;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;
/**
 *
 * @author Phu@
 */
public class Gach extends Sprite 
{
    public int ChuaVatPham ;
    String ImagineVatPham = "/images/Bonus/B";
    boolean SpecialGach ;
    public Gach(int vatpham) throws Exception
    {
         super(Image.createImage("/images/12.gif"), 
	  16,16);
         ChuaVatPham = vatpham;
         if (ChuaVatPham >2)
             SpecialGach = true;
       
        
    }
    public void Action()
    {
        if (SpecialGach ==false)
        {
           // this.setVisible(false);
            return;
        }
        if (ChuaVatPham ==2)
        {
            this.setVisible(false);
        }
        else
        {
            try
            {
            String imagineName  =  ImagineVatPham+ String.valueOf(ChuaVatPham)+".gif" ;
            
            setImage(Image.createImage(imagineName),  16, 16);
            }
            catch(Exception ex)
            {
                throw  null;
            }
            SpecialGach = false;
        }
        
            
    }
}